﻿. 'MSBuild.ps1'

$project = Get-Project
$buildProject = Get-MSBuildProject

$target = $buildProject.Xml.AddTarget("CalipsoAfterBuild")
$target.AfterTargets = "AfterBuild"

$buildJsRscTask = $target.AddTask("Exec")
$buildJsRscTask.SetParameter("Command", '"$(MSBuildToolsPath)\MSBuild.exe" "$(ProjectDir)Comkarl.Web.Build.targets" /t:Calipso-BuildJavaScriptResources /nr:false');
$buildJsRscTask.SetParameter("ContinueOnError", "true")

$buildThemesTask = $target.AddTask("Exec")
$buildThemesTask.SetParameter("Command", '"$(MSBuildToolsPath)\MSBuild.exe" "$(ProjectDir)Comkarl.Web.Build.targets" /t:Calipso-BuildThemes /nr:false');
$buildThemesTask.SetParameter("ContinueOnError", "true")

$project.Save()